<% include header_phone.html %>

<div class="main-1">
	<header>
		<p class="float-left color-0061D2 font-weight-900 font-size-18px padding-10px">WeShare</p>
		<a href="https://bqf7d.app.goo.gl/V9Hh">
			<p id="downloadApp" class="float-right color-313131 font-size-14px padding-14px" data-index='1'>Download APP</p>
		</a>
		<!-- <p class="float-right color-313131 font-size-14px padding-14px">切换城市</p> -->
	</header>
	<p class="color-ffffff title margin-top-14vh">Free WiFi covered in</p>
	<p class="color-ffffff title">10,000+ cities</p>
	<p class="color-ffffff title_1 margin-top-15px">Connect to free WiFi within one click</p>
	<p class="color-ffffff title_1">when you're away from home</p>
	<div class="background-color-ffffff">
		<p class="font-size-25px color-0061D2 padding-top-20px" id="cityName">　</p>
		<h6 class="margin-top-0"><small><%= changeCtiyMassage %></small></h6>
		<!-- <p class="change-city">[Change city]</p> -->
		<p class="margin-top-10px"><span class="wifi-num" id="wifiNum">loading... </span></p>
		<a href="https://bqf7d.app.goo.gl/V9Hh">
			<button class="get-weshare-btn width-70" data-index='2'>Get WeShare app</button>
		</a>
	</div>
</div>
<div class="main-2">
	<p class="title">Off-line WiFi password package</p>
	<p class="title">offered by WeShare</p>
	<div class="row margin-top-30px">
		<div class="col-xs-5">
			<img src="/images/phonemoke1_ph.png">
		</div>
		<div class="col-xs-7">
			<div class="content">
				<p>WeShare offers you a</p>
				<p>password package</p>
				<p>according to your</p>
				<p>city's location. With</p>
				<p>5,000+ WiFi</p>
				<p>passwords, staying</p>
				<p>connected has never</p>
				<p>been easier.</p>
				<a href="https://bqf7d.app.goo.gl/V9Hh">
					<button class="get-weshare-btn width-95 margin-top-30px" data-index='3'>Get WeShare app</button>
				</a>
			</div>
		</div>
	</div>
</div>
<div class="main-3">
	<p class="title">It's all about connection.</p>
	<p class="title_1">Stay connected by using free WiFi shared by other users</p>
	<div class="row text-align-center">
		<div class="col-xs-7 padding-right-0">
			<div class="row margin-top-25px">
				<div class="col-xs-3 padding-0 fonction-icon-div">
					<img class="width" src="/images/analyzer@2x.png">
				</div>
				<div class="col-xs-9 text-align-left fonction-content-div">
					WiFi analyzer helps you test WiFi speed and Wifi security
				</div>
			</div>
			<div class="row margin-top-25px">
				<div class="col-xs-3 padding-0 fonction-icon-div">
					<img class="width" src="/images/wifi@2x.png">
				</div>
				<div class="col-xs-9 text-align-left fonction-content-div">
					Available WiFi can be connected directly
				</div>
			</div>
			<div class="row margin-top-25px">
				<div class="col-xs-3 padding-0 fonction-icon-div">
					<img class="width" src="/images/map@2x.png">
				</div>
				<div class="col-xs-9 text-align-left fonction-content-div">
					Click on WiFi map to see all available WiFi within 1 kilometer
				</div>
			</div>
			<div class="row padding-top-20px">
				<a href="https://bqf7d.app.goo.gl/V9Hh">
					<button class="get-weshare-btn width-95 margin-top-30px"  data-index='4'>Get WeShare app</button>
				</a>
			</div>
		</div>
		<div class="col-xs-5  padding-0">
			<img class="img" src="/images/phonemock2_ph.png">
		</div>
	</div>


</div>
<div class="main-4">
	<p class="title">Comments from users</p>
	<div class="row comments margin-top-20px">
		<div class="col-xs-3">
			<img src="/images/3_ph@2x.png">
		</div>
		<div class="col-xs-9 text-align-left padding-left-0 ">
			<span class="comment-uname"> Patrick Polk </span>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<p class="comment-content">This app has helped me stay connected since I downloaded it</p>
		</div>
	</div>
	<div class="row comments margin-top-20px">
		<div class="col-xs-3">
			<img src="/images/2_ph@2x.png">
		</div>
		<div class="col-xs-9 text-align-left padding-left-0 ">
			<span class="comment-uname"> Ronald Foster </span>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<p class="comment-content">Very helpful! Great WiFi sharing app.</p>
		</div>
	</div>
	<div class="row comments margin-top-20px">
		<div class="col-xs-3">
			<img src="/images/1_ph@2x.png">
		</div>
		<div class="col-xs-9 text-align-left padding-left-0 ">
			<span class="comment-uname"> Jack Mcdaniel </span>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<i class="glyphicon glyphicon-star color-FFDA00"></i>
			<p class="comment-content">Nice app for finding free WIFI. Easy to use I love it!</p>
		</div>
	</div>
</div>

<footer>
    <div class="container">
	    <small>© 2014-2016上海易跋信息科技有限公司版权所有</small>
	</div>
</footer>
<script type="text/javascript">
	$(document).ready(function() {
		// 填写城市名称
		$('#cityName')[0].innerHTML = window.location.pathname.substring(1);

    	// 获取城市list json文件
		$.getJSON("/json/cityList.json", function(json){

			// 初始化城市匹配标志为false
			var matchFlag = false;
			$(json).each(function(index, element) {

				if ((element.substring(element.indexOf('|') + 1)).substring(0, (element.substring(element.indexOf('|') + 1)).indexOf('|')).toLowerCase() == unescape(window.location.pathname.substring(1).toLowerCase())) {
					// 城市匹配成功
					matchFlag = true;
					// 获取所选城市的wifi数
					$.ajax({
					  	url: 'http://wifi.18wifibank.com/OW2DD/getCityInfo?cityCode=' + element.substring(element.lastIndexOf('|') + 1),
						type:'get',
					  	dataType: 'jsonp',
						processData: true,
						timeout: 5000,
						success:function(data, status){
							// console.log(data.data.wifiNum);
							// 填写password
							$('#wifiNum')[0].innerHTML = data.data.wifiNum + '<span class="font-weight-normal"> passwords</span>';
						},
						error:function(XHR, textStatus, errorThrown){
							console.log('error')
						}
					});
				}
			});

			// 判断是否匹配城市
			if (!matchFlag) {
				// 没有匹配的场合
				$('#wifiNum')[0].innerHTML = '未检索到当前城市的wifi';
				console.log('json文件中未找到当前城市')
			}

			// 点击download/下载链接的场合
			$('.get-weshare-btn, #downloadApp').on('click', function() {
				console.log($(this).data('index'));

				zhuge.track('点击下载按钮' + $(this).data('index') + '-phone', {
					'client' : 'phone'
				});
				// 苹果系统的场合
				if (ismobile(1) == 0) {
					window.location.href = 'https://itunes.apple.com/cn/app/WeShareWiFi';
					return false;
				}
			})

		});

		// 埋点
		if ('Switched to a nearby city with Free WiFi' == '<%= changeCtiyMassage %>') {
			console.log('当前IP没有密码包');
			zhuge.track('当前IP没有密码包', {
				'client' : 'phone'
			});
		}
	})


	/**
	 * [isMobile 判断平台]
	 * @param test: 0:iPhone    1:Android
	 */
	function ismobile(test){
	    var u = navigator.userAgent, app = navigator.appVersion;
	    if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
	     if(window.location.href.indexOf("?mobile")<0){
	      try{
	       if(/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)){
	        return '0';
	       }else{
	        return '1';
	       }
	      }catch(e){}
	     }
	    }else if( u.indexOf('iPad') > -1){
	        return '0';
	    }else{
	        return '1';
	    }
	};
	 
</script>
	
<% include footer.html %>
